package com.zjc.yohoshop.adapter;

import com.chad.library.adapter.base.BaseMultiItemQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.zjc.yohoshop.R;
import com.zjc.yohoshop.bean.HomeMenuEntity;

import java.util.List;

/**
 * 侧滑菜单适配器
 */
public class HomeMenuAdapter extends BaseMultiItemQuickAdapter<HomeMenuEntity.Values, BaseViewHolder> {
    /**
     * Same as QuickAdapter#QuickAdapter(Context,int) but with
     * some initialization data.
     *
     * @param data A new list is created out of this one to avoid mutable list
     */
    public HomeMenuAdapter(List<HomeMenuEntity.Values> data) {
        super(data);
        addItemType(0, R.layout.item_home_menu);
    }

    @Override
    protected void convert(BaseViewHolder helper, HomeMenuEntity.Values item) {
        helper.setText(R.id.tv_menu_name, item.menu_name);
    }
}
